package xyz.renyumeng.xkm.shop.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.renyumeng.xkm.model.shop.ProductTypeInfo;
import xyz.renyumeng.xkm.result.Result;
import xyz.renyumeng.xkm.shop.service.ProductTypeInfoService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author renyumeng
 * @date Created in 19:51 2023/7/4
 */
@Api(tags = "用户商品类别接口")
@RestController
@RequestMapping("/user/shop/type")
public class UserProductTypeController {
    @Resource
    private ProductTypeInfoService productTypeInfoService;

    @GetMapping("/{parentId}")
    @ApiOperation(value = "查询子类型")
    public Result<List<ProductTypeInfo>> getChildrenType(@PathVariable Long parentId){
        return productTypeInfoService.getChildrenType(parentId);
    }
}
